<script setup lang="ts">
import { getDeviceLogList } from '@/api/device';
import type { DeviceLog } from '@/api/device/type';
import { onMounted, ref } from 'vue';

const logList = ref([] as DeviceLog[]);

onMounted(() => {
    getDeviceLogList().then((res) => {
        logList.value = res.data;
    })
})

</script>

<template>
    <div class="container">
        <div class="content">
            <el-table :data="logList" style="width: 100%" stripe border>
                <el-table-column prop="id" label="ID" />
                <el-table-column prop="deviceId" label="机器ID" />
                <el-table-column prop="temperature" label="温度" />
                <el-table-column prop="humidity" label="湿度" />
                <el-table-column prop="uploadTime" label="上传时间" />
            </el-table>
        </div>
    </div>
</template>

<style lang="scss" scoped>
.content {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
}
</style>